package com.xydtech.ecard.config.service.impl;

import java.util.List;
import com.xydtech.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xydtech.ecard.config.mapper.EcardPosterShareConfMapper;
import com.xydtech.ecard.config.domain.EcardPosterShareConf;
import com.xydtech.ecard.config.service.IEcardPosterShareConfService;
import com.xydtech.common.core.text.Convert;

/**
 * 电子名片海报分享配置信息记录Service业务层处理
 * 
 * @author xydtech
 * @date 2022-12-09
 */
@Service
public class EcardPosterShareConfServiceImpl implements IEcardPosterShareConfService 
{
    @Autowired
    private EcardPosterShareConfMapper ecardPosterShareConfMapper;

    /**
     * 查询电子名片海报分享配置信息记录
     * 
     * @param id 电子名片海报分享配置信息记录主键
     * @return 电子名片海报分享配置信息记录
     */
    @Override
    public EcardPosterShareConf selectEcardPosterShareConfById(Long id)
    {
        return ecardPosterShareConfMapper.selectEcardPosterShareConfById(id);
    }

    /**
     * 查询电子名片海报分享配置信息记录列表
     * 
     * @param ecardPosterShareConf 电子名片海报分享配置信息记录
     * @return 电子名片海报分享配置信息记录
     */
    @Override
    public List<EcardPosterShareConf> selectEcardPosterShareConfList(EcardPosterShareConf ecardPosterShareConf)
    {
        return ecardPosterShareConfMapper.selectEcardPosterShareConfList(ecardPosterShareConf);
    }

    /**
     * 新增电子名片海报分享配置信息记录
     * 
     * @param ecardPosterShareConf 电子名片海报分享配置信息记录
     * @return 结果
     */
    @Override
    public int insertEcardPosterShareConf(EcardPosterShareConf ecardPosterShareConf)
    {
        ecardPosterShareConf.setCreateTime(DateUtils.getNowDate());
        return ecardPosterShareConfMapper.insertEcardPosterShareConf(ecardPosterShareConf);
    }

    /**
     * 修改电子名片海报分享配置信息记录
     * 
     * @param ecardPosterShareConf 电子名片海报分享配置信息记录
     * @return 结果
     */
    @Override
    public int updateEcardPosterShareConf(EcardPosterShareConf ecardPosterShareConf)
    {
        ecardPosterShareConf.setUpdateTime(DateUtils.getNowDate());
        return ecardPosterShareConfMapper.updateEcardPosterShareConf(ecardPosterShareConf);
    }

    /**
     * 批量删除电子名片海报分享配置信息记录
     * 
     * @param ids 需要删除的电子名片海报分享配置信息记录主键
     * @return 结果
     */
    @Override
    public int deleteEcardPosterShareConfByIds(String ids)
    {
        return ecardPosterShareConfMapper.deleteEcardPosterShareConfByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除电子名片海报分享配置信息记录信息
     * 
     * @param id 电子名片海报分享配置信息记录主键
     * @return 结果
     */
    @Override
    public int deleteEcardPosterShareConfById(Long id)
    {
        return ecardPosterShareConfMapper.deleteEcardPosterShareConfById(id);
    }
    /**
     * 保存海报分享个人信息记录
     *
     * @author yjs
     * @date 2022/7/28 10:48
     */
    @Override
    public int addPosterShareConf(EcardPosterShareConf ecardPosterShareConf) {
        return ecardPosterShareConfMapper.addPosterShareConf(ecardPosterShareConf);
    }
}
